/* Copyright (C) 2003, Charles Wang.
 * Author:  Charles Wang <charles@linux.net.cn>
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANT; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public LIcense for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307, USA.
 */
#ifndef __PROC_PARSER_H__
#define __PROC_PARSER_H__

#ifndef __MBTYPES_H__
#include "mbtypes.h"
#endif

typedef struct _cpuinfo_struct cpuinfo_struct;
struct _cpuinfo_struct {
    int dummy;
};
int  parse_cpuinfo(cpuinfo_struct *cpuinfo);
void free_cpuinfo(cpuinfo_struct *cpuinfo);

typedef struct _meminfo_struct meminfo_struct;
struct _meminfo_struct {
    long total; /* The capacity of memory in bytes. */
    long used;  /* The used memory in bytes. */
    long free;  /* The free memory in bytes. */
};
int  parse_meminfo(meminfo_struct *meminfo);
void free_meminfo(meminfo_struct *meminfo);

typedef struct _filesystem_array filesystem_array;
struct _filesystem_array {
    int     num;        /* The number of the entries here. */
    uint32  devmask;    /* Bit mask for dev/nodev. */
    char   *names[32];  /* Name of the supported filesystems. */
    filesystem_array *next;   /* Next structure to contain more. */
};
int  parse_filesystems(filesystem_array *filesystems);
void free_filesystems(filesystem_array *filesystems);

typedef struct _ide_array ide_array;
struct _ide_array {
    int     num;           /* The number of the entries here. */
    uint32  diskmask;      /* Bit mask for HARDDISK(1)/CDROM(0). */
    char   *devs[32];      /* The device files. */
    long    capacity[32];  /* Capacity of the device. */
    int     cylinders[32]; /* Harddisk only: cylinders/heads/sectores. */
    int     heads[32];
    int     sectors[32];
    ide_array  *next;      /* Next structure to contain more. */
};
int  parse_ides(ide_array *ides);
void free_ides(ide_array *ides);

#define MISCSI_USBSTORAGE    1
#define MISCSI_IDECDRW       2
#define MISCSI_CDROM         3
#define MISCSI_HARDDISK      4
typedef struct _scsi_array scsi_array;
struct _scsi_array {
    int     num;           /* The number of the entries here. */
    char    types[32];     /* The type code of scsi devices. */
    char   *devs[32];      /* The device files. */
    scsi_array  *next;     /* Next structure to contain more. */
};
int  parse_scsis(scsi_array *scsis);
void free_scsis(scsi_array *scsis);

typedef struct _partition_array partition_array;
struct _partition_array {
    int     num;             /* The number of the entries here. */
    short   major[32];
    short   minor[32];
    int     blocks[32];
    char   *names[32];
    partition_array  *next;  /* Next structure to contain more. */
};
int  parse_partitions(partition_array *partitions);
void free_partitions(partition_array *partitions);

#endif
